cmake_minimum_required(VERSION 3.10.2)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

project(control)

add_executable(control
    vehicle.cpp
    main.cpp
)

find_package(MAVSDK REQUIRED)
set(ENV{PKG_CONFIG_PATH} /usr/lib64/pkgconfig)
find_package(PkgConfig)
pkg_search_module(dsoftbus REQUIRED dsoftbus)

target_link_libraries(control
    MAVSDK::mavsdk
    pthread
    ${dsoftbus_LIBRARIES}
)

target_include_directories(control PUBLIC ${dsoftbus_INCLUDE_DIRS})

message(STATUS "=== OBS_LIBRARIES: ${dsoftbus_LIBRARIES}")

if(NOT MSVC)
    add_compile_options(control PRIVATE -Wall -Wextra)
else()
    add_compile_options(control PRIVATE -WX -W2)
endif()
